package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 订单表
 * @author 李鼎
 * @TableName mini_order
 */
@TableName(value ="mini_order")
@Data

@NoArgsConstructor
@AllArgsConstructor
public class MiniOrder implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    /** id */
    private Long id;

    /** 订单号 */
    @Excel(name = "订单号")
    private String orderNo;

    /** 产品id */
    private Long productId;

    /** 产品名称 */
    @Excel(name = "产品名称")
    private String productName;

    /** 费用 */
    @Excel(name = "费用")
    private BigDecimal fee;

    /** 支付时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** openid */
    @Excel(name = "openid")
    private String openid;

    /** 订单状态 0未支付 1已支付 */
    @Excel(name = "订单状态 0未支付 1已支付")
    private String state;

    /** 邀请用户id */
    private Long inviteUserId;

    /** 邀请方式 p代理商 u用户 */
    private String inviteType;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /** 搜索值 */
    @JsonIgnore
    @TableField(exist = false)
    private String searchValue;
    /** 请求参数 */
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;

    public MiniOrder(Long id, String orderNo, Long productId, String productName, BigDecimal fee, Date payTime, Long userId, String openid, String state, Long inviteUserId, String inviteType, Timestamp createTime) {
        this.id = id;
        this.orderNo = orderNo;
        this.productId = productId;
        this.productName = productName;
        this.fee = fee;
        this.payTime = payTime;
        this.userId = userId;
        this.openid = openid;
        this.state = state;
        this.inviteUserId = inviteUserId;
        this.inviteType = inviteType;
        this.createTime = createTime;
    }
}